package com.eazy.lkv2.web.controller.mobile.activity;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.eazy.lkv2.web.controller.BaseController;
import com.eazy.lkv2.web.entity.Activity;
import com.eazy.lkv2.web.service.hotel.ActivityService;

/**
 * 
 * @author wuhuaiqian
 * 2016年8月20日 下午10:07:02
 *活动管理
 *我直接在你的controller上改会冲突,不知道怎么解决所以就新建了一个
 */
@Controller
public class ActivityController2 extends BaseController<Activity, Integer> {
	@Autowired
	private ActivityService activityService;
	@RequestMapping(value = "activitys.html", method = RequestMethod.GET)
	public String activitys(Model model) {
		List<Map<String,Object>> select = activityService.select();
		model.addAttribute("data", select);
		return getDefault("activity/activitys");
	}
	@RequestMapping(value="detail.html",method = RequestMethod.GET)
	public String detail(Integer id,Model m){
		Activity findById = activityService.findById(id);
		m.addAttribute("data", findById);
		return getDefault("activity/detail");
	}
	
}
